﻿@model HFCMS.Web.Models.LoginModel
@{
    Layout = null;
}

<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta charset="utf-8" />
    <title>登录页 - HFCMS</title>
    <meta name="description" content="用户登录页" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
    <link rel="shortcut icon" href="~/Content/favicon.ico">
    <link rel="stylesheet" href="~/Content/dist/css/bootstrap.min.css" />
    <link rel="stylesheet" href="~/Content/font-awesome/4.2.0/css/font-awesome.min.css" />
    <link rel="stylesheet" href="~/Content/dist/css/ace-fonts.css" />
    <link rel="stylesheet" href="~/Content/dist/css/ace.css" />
    <link rel="stylesheet" href="~/Content/dist/css/ace-rtl.min.css" />
    <link rel="stylesheet" href="~/Content/dist/css/login/style.css" />
    <style>
        body {
            height: 100%;
            background: #16a085;
            overflow: hidden;
        }
        canvas {
            z-index: -1;
            position: absolute;
        }
    </style>
    <script src="~/Content/dist/js/login/jquery.js"></script>
    <script src="~/Content/dist/js/login/verificationNumbers.js"></script>
    <script src="~/Content/dist/js/login/Particleground.js"></script>
    <script>
    $(document).ready(function () {
        //粒子背景特效
        $('body').particleground({
            dotColor: '#5cbdaa',
            lineColor: '#5cbdaa'
        });
 
   
        $("#btnLogin").click(function () {
            //if ($("#hid_code").val() != $("#Code").val()) {
            //    alert("验证码错误");
            //}

            var param = {
                UserName: $("#UserName").val(),
                Password: $("#Password").val(),
                Code: $("#Code").val(),
                RememberMe: false
            };
       
            $.ajax({
                type: "post",
                url: "@Url.Action("Login", "Account")",
                data:{
                    model:param,
                    returnUrl:"",
                    ts:new Date().getTime()
                },
                success: function (data) {
                    alert(data);
                },
                error: function () {


                }
            });
        });
        $("#hid_code").val("@Session["code"]");
    });
    function changeCheckCode() {
        $("#img").attr("src", $("#img").attr("src") + "?" + Math.random());  //id=2
        $("#hid_code").val("@Session["code"]");
    }
</script>
</head>
<body class="login-layout">
    @Html.Hidden("hid_code")
    <div class="main-container">
        <div class="main-content fcontent">
            <div class="row">
                <div class="col-sm-10 col-sm-offset-1">
                    <div class="login-container">
                        <div class="position-relative">
                            <div id="login-box" class="login-box visible widget-box no-border">
                                <div class="widget-body">
                                    <div class="widget-main">
                                        <h3 class="header bluegreen lighter bigger fh4 center">
                                            <i class="ace-icon fa fa-h-square bluegreen"></i>
                                            <strong>汉方内容管理系统</strong>
                                            <em>HFCMS Management System</em>
                                        </h3>
                                        <div class="space-6"></div>
                                        @using (Html.BeginForm("Login", "Account"))
                                        {
                                            <fieldset>
                                                <label class="block clearfix">
                                                    <span class="block input-icon input-icon-left">
                                                        @*<input id="username" type="text" class="form-control fcontrol" placeholder="账号" />*@
                                                        @Html.TextBoxFor(m => m.UserName, new { @class = "form-control fcontrol", @placeholder = "账号" })
                                                        <i class="ace-icon  fl-icon fa fa-user ficon"></i>
                                                    </span>
                                                </label>
                                                <label class="block clearfix">
                                                    <span class="block input-icon input-icon-left">
                                                        @*<input id="password" type="password" class="form-control fcontrol" placeholder="密码" />*@
                                                        @Html.TextBoxFor(m => m.Password, new { @class = "form-control fcontrol", @placeholder = "密码" })
                                                        <i class="ace-icon ficon fa fa-lock ficon"></i>
                                                    </span>
                                                </label>
                                                <label class="block clearfix">
                                                    <span class="block input-icon input-icon-left">
                                                        <i class="ace-icon ficon fa fa-pencil ficon"></i>
                                                        @*<input id="code" type="text" class="form-control fcontrol width-70 checkcode" placeholder="验证码" />*@
                                                        @Html.TextBoxFor(m => m.Code, new { @class = "form-control fcontrol width-70 checkcode", @placeholder = "验证码" })

                                                        <a href="javascript:void(0)" onclick="changeCheckCode();return false;">

                                                            <img id="img" src="@Url.Action("ShowValidateCode","Account")" style="float: right; height: 40px;" />
                                                        </a>
                                                        @*<canvas class="J_codeimg width-30" id="myCanvas" onclick="createCode()">对不起，您的浏览器不支持canvas，请下载最新版浏览器!</canvas>*@
                                                    </span>
                                                </label>
                                                <div class="clearfix">
                                                    <button id="btnLogin" type="button" class="width-100   btngreen">
                                                        <i class="ace-icon fa fa-key"></i>
                                                        <span class="bigger-110">立即登录</span>
                                                    </button>
                                                </div>
                                                <p class="fcopright">&copy; 2017 FaeryFan 版权所有</p>
                                                <div class="space-4"></div>
                                            </fieldset>
                                        }
                                    </div><!-- /.widget-main -->
                                </div><!-- /.widget-body -->
                            </div><!-- /.login-box -->
                        </div><!-- /.position-relative -->
                    </div>
                </div><!-- /.col -->
            </div><!-- /.row -->
        </div><!-- /.main-content -->
    </div><!-- /.main-container --> 
</body>


</html>
